﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ninject;
using Timetable.Base.Interfaces.Repositories;
using Timetable.Base.Entities;
using Timetable.Base.Interfaces.Validators;
using Timetable.Base.Interfaces.Services;

namespace Timetable.Data.Services.DataServices
{
    public class FacultyService : BaseDataService<Faculty>
    {
        [Inject]
        public IRepository<Faculty> FacultyRepository { get; set; }

        [Inject]
        public IValidator<Faculty> FacultyValidator { get; set; }

        public override IQueryable<Faculty> All()
        {
            return FacultyRepository.Get(orderBy: order => order.OrderBy(f => f.Name));
        }

        public override Faculty GetById(int id)
        {
            return FacultyRepository.GetById(id);
        }

        public override IRepository<Faculty> Repository
        {
            get { return FacultyRepository; }
        }

        public override IValidator<Faculty> Validator
        {
            get
            {
                return FacultyValidator;
            }
        }
    }

    
}
